package com.choosefine.it.company.service.Impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.choosefine.it.base.dto.PageDTO;
import com.choosefine.it.company.dao.CompanyManagerCollectionMapper;
import com.choosefine.it.company.model.CompanyManagerCollection;
import com.choosefine.it.company.service.CompanyManagerCollectionService;
import com.choosefine.it.manager.dao.ManagerFindprojectInfoMapper;
import com.choosefine.it.manager.model.ManagerFindprojectInfo;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

/**
 * 
 * @author chenjian
 * @date 2016-12-3 下午2:22:58
 */
@Service("companyManagerCollectionService")
public class CompanyManagerCollectionServiceImpl implements CompanyManagerCollectionService{
	
	@Autowired
	private CompanyManagerCollectionMapper companyManagerCollectionMapper;
	@Autowired
	private ManagerFindprojectInfoMapper managerFindprojectInfoMapper;

	@Override
	public int saveCompanyManagerCollection(CompanyManagerCollection companyManagerCollection) {
		return companyManagerCollectionMapper.saveCompanyManagerCollection(companyManagerCollection);
	}
		
	@Override
	public Page<CompanyManagerCollection> getCompanyManagerCollection(String userCode, PageDTO page) {
		PageHelper.startPage(page.getPageNum(), page.getPageSize());
		Page<CompanyManagerCollection> pageResult = companyManagerCollectionMapper.selectByUserCode(userCode);
		return pageResult;
	}
	
	@Override
	public ManagerFindprojectInfo selectManagerFindprojectById(Integer publishId) {
		return managerFindprojectInfoMapper.selectManagerFindprojectById(publishId);
	}
	
	@Override
	public int cancleManagerCollectionById(CompanyManagerCollection companyManagerCollection) {
		return companyManagerCollectionMapper.cancleManagerCollectionById(companyManagerCollection);
	}
	
	@Override
	public CompanyManagerCollection findCompanyManagerCollectionByCodeAndId(Map<String, Object> params){
		return companyManagerCollectionMapper.findCompanyManagerCollectionByCodeAndId(params);
	}
	
	@Override
	public int updateCompanyManagerCollection(CompanyManagerCollection companyManagerCollection){
		return companyManagerCollectionMapper.updateCompanyManagerCollection(companyManagerCollection);
	}

}
